﻿<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>聚宝CRM管理系统登录</title>
<link href="../css/style.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../js/common.js"></script>
<script type="text/javascript" src="../js/login.js"></script>
<script type="text/javascript" src="../js/utils.js"></script>
<script type="text/javascript" src="../js/jquery.cookie.js"></script>
<script type="text/javascript">
$(function(){
	$(".login").keypress(function(event){
		if(event.keyCode==13){
			login();
		}
	});
	var s =	$.cookie('QMSK');
	$("#loginName").val(s)
});

</script>
</head>

<body class="WY">
<div id="header">
  <div class="head" style="width:960px;">
    <h1><a href="javascript:void(0);"><img src="../images/logo.png"></a></h1>
    <!-- <div class="enroll fr WY">第一次使用公众平台？<!--<a javascript:void(0)>立即注册</a>/div> -->
  </div>
</div>
  <div class="banner">
  <div class="mainBanner">
  <div class="main_ban">
    <div class="login_box">
    	<h3>登录</h3>

        <div class="login_type"><span>登录类型：</span><select id="userType"><option value="0">总部登录</option><option value="1">商户登录</option></select></div>
        <div id="user"><span class="bg"></span><input type="text" class="user login" id="loginName" value="" placeholder="邮箱/微信号/QQ号"    ></div>
        <div id="paw"><span class="bg"></span><input type="password" class="paw login" id="pwd" value="" placeholder="密码"   ></div>	
        <div class="yanzheng"><span>验证码：</span><input type="text" id="vaildNo"  class="login"  ><b><img src="../userlg/find/validNo" id="authImg" onclick="refresh()"></b><i onclick="refresh()" style="cursor: pointer;">看不清</i></div>

        <div class="login_help"><a href="javascript:void(0)" id="remember" class="hao1 fl"><i></i>记住账号</a><!--<a href="javascript:void(0);" class="hao2 fr">无法登录？</a>--></div>
        <div class="login_btn"><input type="button" value="登录" onclick="login()"></div>
    </div>
    <div class="ma"><img src="../images/qrcode.png"><br>扫描并关注微信公众平台</div>
    </div>
    </div>
    </div>
<div class="content">
    <!--<div class="zixun">
    	<img src="../images/police_l.jpg" style="margin-right:10px;">
    	<img src="../images/police_r.jpg">
        <div class="zixun_txt">
        	<strong>南方航空</strong>
            <p>服务号 -- 如果你是持卡人，可快捷查询信用卡账单、额度及积分；快速还款、申请账单分期；微信转接人工服务；信用卡消费，微信免费笔笔提醒。如果不是持卡人，可以微信办卡！</p>
        </div>
    </div>-->
</div>
<div class="footer"><span>Copyright © 2012-2014 阡陌时空信息科技（北京）有限公司</span></div>

	<script type="text/javascript">
	function login()
    {
		
    	var userName = $("#loginName").val().replace(/\s/gi,'');//去掉空格;
    	var pwd = $("#pwd").val().replace(/\s/gi,'');//去掉空格;
    	var vaildNo = $("#vaildNo").val().replace(/\s/gi,'');//去掉空格;
    	var userType=$("#userType").val();
    	 if(userName==""){
			art.dialog({fixed:true, lock: true,content:"请输入账号",icon:'error',ok:true});	
   	  
    	  $("#loginName").focus();
    	  return;
    	  }
    	 if(pwd==""){
 			art.dialog({fixed:true, lock: true,content:"请输入密码",icon:'error',ok:true});	
     	  $("#pwd").focus();
    	  return;
    	  }
    	 if(vaildNo==""){
  			art.dialog({fixed:true, lock: true,content:"请输入验证码",icon:'error',ok:true});	
       	  $("#vaildNo").focus();
       	  return;
       	  }
    	$.post("../userlg/login",{"loginName":userName,"pwd":pwd,"validNo":vaildNo,"userType":userType},function(dt){
			var rst = JSON.parse(dt);
    		var obj = DealAndShowMsg(dt,false,true);
				if(rst.state==0){
					$.cookie('QMSK',userName)
    			window.location.href="index.html"
				}
    			
			
    	});
    }
	function refresh() {
		document.getElementById("authImg").src='../userlg/find/validNo?now=' + new Date();
		$("#vaildNo").select();
	}
	</script>


</body>
</html>
